#ifndef _DEF_H_
#define _DEF_H_

#include "stm32f10x.h"
#include "CarInfo.h"

typedef u8   	U8;   /*unsigned 8 bit definition */
typedef u16		U16;   /*unsigned 16 bit definition*/
typedef u32   	U32;   /*unsigned 32 bit definition*/
typedef signed char     	S8;   /*signed 8 bit definition */
typedef short signed int	S16;   /*signed 16 bit definition*/
typedef long int    	 	S32;   /*signed 32 bit definition*/

typedef u8		uint8;   /*unsigned 8 bit definition */
typedef u16		uint16;   /*unsigned 16 bit definition*/
typedef u32		uint32;   /*unsigned 32 bit definition*/
//typedef signed char			s8;   /*signed 8 bit definition */
//typedef signed short int		s16;   /*signed 16 bit definition*/
//typedef signed long int		s32;   /*signed 32 bit definition*/

typedef u8   	tU08;   /*unsigned 8 bit definition */
typedef unsigned short int	tU16;   /*unsigned 16 bit definition*/
typedef unsigned long		tU32;   /*unsigned 32 bit definition*/
typedef signed char			tS08;   /*signed 8 bit definition */
typedef short signed int	tS16;   /*signed 16 bit definition*/
typedef signed long int		tS32;   /*signed 32 bit definition*/

typedef unsigned char  BYTE;
typedef unsigned char  UINT8;
typedef unsigned int   UINT;
typedef unsigned short WORD;
typedef unsigned short UINT16;
typedef unsigned long  UINT32;
typedef unsigned long  DWORD;
typedef unsigned long  ULONG;

typedef u8   BOOL;
typedef int   INT;
typedef float FLOAT;

typedef U8	 uint8_t;
typedef U16  uint16_t;
typedef U32  uint32_t;
typedef S8	 int8_t;
typedef S16  int16_t;
//typedef S32  int32_t;

#define T_1MS		  (1)
#define T_1S		  (T_1MS*1000)
#define NOP()         ;

#define STRUCT_OFFSET(stru_name, element) (unsigned long)&((struct stru_name*)0)->element

typedef struct _RESTORE_DATA
{
	U32 id;
	BOOL WithRearViewCamera;
    U8 DisplayState; 
	U8 VideoStandard[4];
	U8 GsensorThreshold;
    EATCStatusInfo EATCStatus;
}RESTORE_DATA;


#define DEBUG_MSG_NAVI_BOARD		(1<<0)
#define DEBUG_MSG_NAVI_SYSTEM		(1<<1)
#define DEBUG_MSG_NAVI_BT			(1<<2)
#define DEBUG_MSG_NAVI_DVD			(1<<3)
#define DEBUG_MSG_NAVI_PAGEEVENT	(1<<4)
#define DEBUG_MSG_NAVI_SPUI			(1<<5)
#define DEBUG_MSG_NAVI_OVERLAY		(1<<6)

typedef  void (*pFunction)(void);

struct struct_basedata {
	RESTORE_DATA restoreData;
	U32 debugMsgBit;
};

#endif
